﻿import React from 'react';
import { Form, Input, Row, Col, Button, DatePicker,Icon, Select } from 'antd';
import './index.css'
import classNames from 'classnames';
import * as SelectTypes from '../../components/Form/CustomSelect';
const FormItem = Form.Item;
const Option = Select.Option;

class QueryForm extends React.Component {

	constructor(props){
		super(props);
	}

	handleSubmit(e) {
		e.preventDefault();
		console.log('Received values of form:', this.props.form.getFieldsValue());
    this.props.onQueryClick(this.props.form.getFieldsValue());
	}

	render() {
		let {visible} = this.props;
    let { getFieldDecorator } = this.props.form;

		const searchCls = classNames({
			'ant-advanced-search-form': true,
			'ant-advanced-search-form-invisible': !visible,
		});

		return (
			<Form horizontal className={searchCls}>
				<Row gutter={16}>
					<Col sm={8}>
						<FormItem label="学号" labelCol={{ span: 10 }} 	wrapperCol={{ span: 14 }}>
              {getFieldDecorator('id')(<Input placeholder="请输入学生考号" />)}
						</FormItem>
						<FormItem	label="入学时间"	 labelCol={{ span: 10 }}	wrapperCol={{ span: 14 }}>
              {getFieldDecorator('enterDate')(SelectTypes.YearSelect)}
						</FormItem>

					</Col>
					<Col sm={8}>
						<FormItem	label="学生姓名"	 labelCol={{ span: 10 }} 	wrapperCol={{ span: 14 }}>
              {getFieldDecorator('name')(<Input placeholder="请输入学生姓名" />)}
						</FormItem>
						<FormItem label="毕业时间" labelCol={{ span: 10 }} wrapperCol={{ span: 14 }}>
              {getFieldDecorator('outDate')(SelectTypes.YearSelect)}
						</FormItem>
					</Col>
					<Col sm={8}>
            <FormItem label="就业状态" labelCol={{ span: 10 }}  wrapperCol={{ span: 14 }}>
              {getFieldDecorator('status')(SelectTypes.OrderStatusSelect)}
            </FormItem>
					</Col>
				</Row>
				<Row>
					<Col span={12} offset={12} style={{ textAlign: 'right' }}>
						<Button type="primary" onClick={this.handleSubmit.bind(this)}>查询</Button>
						<Button onClick={()=>{this.props.form.resetFields()}}>清除条件</Button>
					</Col>
				</Row>
			</Form>
		);
	}
}

QueryForm = Form.create()(QueryForm);

export default QueryForm;
